// +----------------------------------------------------------------------
// | Manong.Cloud [ 领酷码农云 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020 http://www.manong.cloud All rights reserved.
// +----------------------------------------------------------------------
// | Author: 稻草人 <qinuoyun@qq.com>
// +----------------------------------------------------------------------
// | Member: 围棋 飘逸者 Loumt Silence24
// +----------------------------------------------------------------------

export default class Middleware extends MiddlewareController {
    handle(ctx) {
        if (ctx.state.auth) {
            let tokenData = ctx.state.auth
            return this.modules("Account").where({"mobile": tokenData['mobile']}).first();
        } else {
            return null
        }
    }
}